package com.whfc.mach.dao;

import com.whfc.mach.dto.obd.MaintainRuleDTO;
import com.whfc.mach.entity.AppMaintainRule;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface AppMaintainRuleMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(AppMaintainRule record);

    int insertSelective(AppMaintainRule record);

    AppMaintainRule selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(AppMaintainRule record);

    int updateByPrimaryKey(AppMaintainRule record);

    /**
     * 逻辑删除
     *
     * @param deptId
     */
    void deleteLogicByDeptId(@Param("deptId") Integer deptId);

    /**
     * 批量插入
     *
     * @param deptId
     * @param ruleList
     */
    void batchInsert(@Param("deptId") Integer deptId,
                     @Param("ruleList") List<MaintainRuleDTO> ruleList);

    /**
     * 根据组织机构id查询
     *
     * @param deptId
     * @return
     */
    List<MaintainRuleDTO> selectByDeptId(@Param("deptId") Integer deptId);

    /**
     * 查找所有启动的规则
     *
     * @return
     */
    List<MaintainRuleDTO> selectAllEnableRule();
}